package com.cy.thread.queue;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Objects;

/**
 * @author 残影
 * @date 2021/3/25 11:09
 */
@Getter
@AllArgsConstructor
public enum CountryEnum {
    ONE(1, "齐"), TWO(2, "楚"), THREE(3, "燕"), FOUR(4, "赵"), FIVE(5, "魏"), SIX(6, "韩");

    private Integer retcode;
    private String retMessage;

    public static CountryEnum forEach_countryEnum(int index) {

        CountryEnum[] myArray = CountryEnum.values();

        for(CountryEnum ce : myArray) {
            if(Objects.equals(index, ce.getRetcode())) {
                return ce;
            }
        }

        return null;
    }
}
